/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * <p>Project: jse2303 - List4
 * <p>Powered by webrx On 2023-07-19 11:25:47
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class List4 {
    public static void main(String[] args) {


        List<Integer> list = new ArrayList<>(List.of(1, 2, 3, 10, 6, 4, 9, 12));
        list.add(15);
        System.out.println(list);

        //洗牌
        Collections.shuffle(list);
        Collections.shuffle(list);
        Collections.shuffle(list);
        System.out.println(list);

        //升序
        Collections.sort(list, (a, b) -> b - a); //降序

        list.sort((a, b) -> a - b); //升序
        System.out.println(list);
    }
}
